#ifndef NANE_WIN32MOUSE_H
#   define  NANE_WIN32MOUSE_H

#   include "nane/InputSystem/IInputDeviceSystem.h"
#   include "nane/core/WinAPI/winapi.h"

#   include <vector>

namespace nane
{

    struct MouseMessage
    {
        byte axis;
        int32 value;
        MouseMessage( byte _axis, int32 _value )
            : axis( _axis )
            , value( _value )
        {
        }
    };
    
    class Win32Mouse
        : public IInputDeviceSystem
    {
    public:
        Win32Mouse();
        ~Win32Mouse();

        LRESULT WndProc( HWND _hWnd, UINT _msg, WPARAM _wParam, LPARAM _lParam );

    public:
        bool Initialize();
        void Shutdown();
        EInputDevice::raw_type GetDeviceType();
        bool InitializeContext( IWindow::OSHandle _windowHandle );
        void ShutdownContext();
        bool Poll( byte* _deviceNum, byte* _axis, int32* _value );

    private:
        HWND m_hWnd;
        WNDPROC m_wndProc;
        int32 m_oldMouseX;
        int32 m_oldMouseY;
        uint32 m_currentMessage;
        bool m_previousWasMouseMove;
        bool m_secondEmptyPoll;
        std::vector<MouseMessage> m_mouseMessages;
    };
}

#endif	// NANE_WIN32MOUSE_H
